<?php 

$a = "   001 ";
echo var_dump(ltrim($a,"0 "));
echo var_dump(intval($a));